<%= render 'common/notice' %>

<div class="panel-no-border panel-primary">
  <!-- Default panel contents -->
  <div class="panel-heading"><strong><%= @user.name %></strong></div>
  <div class="panel-body">
    <div class="row gray-font-12">
      <div class="col-xs-12">
        <span>主题: <%= @user.topics.size %></span>
        <span class="mgl20">文章: <%= @user.articles.size %></span>
        <span class="mgl20">积分: <%= @user.score %></span>
      </div>
      <br/><br/>
      <div class="col-xs-12"><%= @user.intro %></div>
      <br/><br/>
      <%- if can? :manage, @user %>
          <div class="col-xs-12">
            <span class="text-left"><%= link_to "编辑资料", edit_user_registration_path %></span>
          </div>
      <% end %>
    </div>
  </div>
  <%- ta = (current_user&&current_user.id==@user.id ? '我' : 'TA') %>
      <ul class="nav nav-tabs mgt10">
        <li role="presentation" <%- if controller_action?(:users_topics) %>class="active"<%end%> >
          <%= link_to "#{ta}发布的", user_topics_path %>
        </li>
        <li role="presentation" <%- if controller_action?(:users_follows) %>class="active"<%end%> >
            <%= link_to "#{ta}关注的", user_follows_path %>
        </li>
      </ul>

      <%- if controller_action?(:users_follows) %>
          <%= render partial: 'articles/list_simple', locals:{ articles: @articles} %>
      <%- elsif controller_action?(:users_topics) %>
          <%= render partial: 'topics/list_simple', locals:{ topics: @topics} %>
      <%end%>

</div>

